package com.company;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        /**

         * 根据输入的数字，判断数组strs的值 然后进行逻辑判断

         */
                String[] strs = { "石头", "剪刀", "布" };

                Scanner sc = new Scanner(System.in);

                System.out.println("请输入您的选择:(0.石头 1.剪刀 2.布)");

                int input = sc.nextInt();

                String input_str = strs[input];

                System.out.println("您输入的是:" + input_str);

                int ran = (int) (Math.random() * 3);

                String sys_str = strs[ran];

                System.out.println("系统输出的是：" + sys_str);

                if (input_str.equals(sys_str)) {

                    System.err.println("你们是平局");

                } else if (input_str == "石头" && sys_str == "剪刀" || input_str == "剪刀"

                        && sys_str == "布" || input_str == "布" && sys_str == "石头") {

                    System.err.println("你赢了");

                } else {

                    System.err.println("你输了");

                }

            }

        }
